package utils

import "time"

func BoolPtr(b bool) *bool {
	return &b
}

const DefaultLayout = "2006-01-02 15:04:05"

// YYYY-MM-DD HH:mm:ss
func FormatTime(t *time.Time, layouts ...string) string {
	if t == nil {
		return ""
	}
	var layout = DefaultLayout
	if len(layouts) > 0 {
		layout = layouts[0]
	}
	return t.Format(layout)
}
